home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / AIncludes / SonyEqu.a < prev    next >
Encoding:
Text File  |  1992-01-29  |  24.1 KB  |  639 lines  |  [TEXT/MPS ]

  1. ; Version: 3.23
  2. ; Created: Friday, October 20, 1989 at 9:52:02 PM
  3. ;
  4. ; File: SonyEqu.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1984-1991
  8. ; All Rights Reserved
  9. ;
  10. ;--------------------------------------------------------------------
  11. ;
  12. ; The following information was formerly in "private" files that were
  13. ; not released to the general developer community.
  14. ;
  15. ; The information in this file is not needed for normal application
  16. ; development. These equates and macros were necessary for development
  17. ; of the Macintosh ToolBox and Operating System, and are likely to be
  18. ; dependent on their current implementation. Use of any information
  19. ; in this file is likely to cause your software to fail on future
  20. ; versions of Macintosh system software or hardware.
  21. ;
  22. ; Apple Developer Support will not support any use of the following
  23. ; information.
  24. ;
  25. ; In order to prevent any "accidental" use of this information, it has
  26. ; been disabled using the conditional-assembly variable defined below.
  27. ; If you change this to a non-zero value, you're on your own.
  28. ;--------------------------------------------------------------------
  29.  
  30.     IF &TYPE('__IncludingSonyEqu__') = 'UNDEFINED' THEN
  31. __IncludingSonyEqu__    SET    1
  32.  
  33.  
  34. ; If SonyNonPortable is defined to be non-zero, Then a machine type must be specified!
  35.  
  36.                   IF          (&TYPE('SonyNonPortable') = 'UNDEFINED') THEN
  37. SonyNonPortable   EQU         0
  38.                   ENDIF
  39.  
  40.                   IF          (&TYPE('onMac') = 'UNDEFINED') THEN 
  41. onMac             EQU         1
  42.                   ENDIF
  43.  
  44.                   IF          (&TYPE('onMacPP') = 'UNDEFINED') THEN
  45. onMacPP           EQU         0
  46.                   ENDIF
  47.  
  48.                   IF          (&TYPE('onNuMac') = 'UNDEFINED') THEN
  49. onNuMac           EQU         0
  50.                   ENDIF
  51.  
  52.                   IF          (&TYPE('onMvMac') = 'UNDEFINED') THEN
  53. onMvMac           EQU         0
  54.                   ENDIF
  55.  
  56.                   IF          (&TYPE('onHcMac') = 'UNDEFINED') THEN
  57. onHcMac           EQU         0
  58.                   ENDIF
  59.  
  60. ; forDiskDup should be set to 0 for most uses
  61.  
  62.                   IF          (&TYPE('forDiskDup') = 'UNDEFINED') THEN
  63. forDiskDup        EQU         0
  64.                   ENDIF
  65.  
  66. ; Note: supportsDCD means support for pass-thru connector as well.
  67. ; If this is 1, firstDCD and maxDCDcnt equates are needed as well.
  68. ; GetDrive must be adjusted for number of drives, as well!
  69.  
  70.                   IF          onMac THEN
  71. supportsPWM       EQU         1                         ; set to 1 if PWM supported
  72. maxDrvNum         EQU         4
  73. supportsDCD       EQU         1                         ; set to 1 to include DCD code
  74. firstDCD          EQU         3
  75. maxDCDcnt         EQU         2
  76. iwmMode           EQU         $1F
  77.                   ENDIF
  78.  
  79.                   IF          onMacPP THEN
  80. supportsPWM       EQU         1                         ; set to 1 if PWM supported
  81. maxDrvNum         EQU         5
  82. supportsDCD       EQU         1                         ; set to 1 to include DCD code
  83. firstDCD          EQU         4
  84. maxDCDcnt         EQU         2
  85. iwmMode           EQU         $17                       ; changed for Brian Howard to set half speed
  86. ; <?? same as Mac ??>
  87.                   ENDIF
  88.  
  89.                   IF          (&TYPE('onNuMacDCD') = 'UNDEFINED') THEN
  90. onNuMacDCD        EQU         0
  91.                   ENDIF
  92.  
  93.                   IF          onNuMac|onMvMac THEN
  94. supportsPWM       EQU         0                         ; set to 1 if PWM supported
  95.                   IF          onNuMacDCD THEN
  96. maxDrvNum         EQU         4
  97. supportsDCD       EQU         1                         ; set to 1 to include DCD code
  98. firstDCD          EQU         3
  99. maxDCDcnt         EQU         2
  100.                   ELSE
  101. maxDrvNum         EQU         2
  102. supportsDCD       EQU         0                         ; set to 1 to include DCD code
  103.                   ENDIF
  104. iwmMode           EQU         $17
  105.                   ENDIF
  106.  
  107.                   IF          onHcMac THEN
  108. supportsPWM       EQU         0                         ; set to 1 if PWM supported
  109. maxDrvNum         EQU         5
  110. supportsDCD       EQU         1                         ; set to 1 to include DCD code
  111. firstDCD          EQU         4
  112. maxDCDcnt         EQU         2
  113. iwmMode           EQU         $17
  114.                   ENDIF
  115.  
  116.  
  117.                   IF          SonyNonPortable THEN
  118.  
  119.                   IF          (&TYPE('supportsMFM') = 'UNDEFINED') THEN
  120. supportsMFM       EQU         0
  121.                   ENDIF
  122.  
  123. ; SonyVars Data Structure (offsets):
  124. ; (1) Driver local vars.
  125. ; (2) Drive-specific vars.
  126. ; (3) More driver local vars.
  127. ; (4) Direct-connect driver locals.
  128. ;
  129. ; Drive Constants:
  130. ; (1) Floppy drive constants (tuneable).
  131. ; (2) Floppy drive sense/control constants.
  132. ; (3) Floppy drive formatting constants.
  133. ; (4) Direct-connect drive constants.
  134. ;
  135. ; Driver Constants:
  136. ; (1) Driver Control codes.
  137. ;
  138. ; Driver Vectors:
  139. ; (1) Location of disk routine vectors.
  140. ;
  141. ;_______________________________________________________________________
  142.  
  143. ;_______________________________________;
  144. ; ;
  145. ; SonyVars Data Structure (offsets): ;
  146. ;_______________________________________;
  147.  
  148. ;_______________________________________;
  149. ;
  150. ; (1) Driver local vars. ; * = known to be used in a copy-
  151. ; protection scheme.
  152. ; +---------------------+ DiskUnitPtr <-----+
  153. ; | | |
  154. ; | "driver local vars" | |
  155. ; | | EjectWait |
  156. ; +---------------------+ <----+ |
  157. ; | | Track | |
  158. ; | drive1 | DrvLclLth |
  159. ; | | DriveMisc | |
  160. ; +---------------------+ <----+ |
  161. ; | | Track |
  162. ; | drive2 | Sony disk driver
  163. ; | | DriveMisc vars, plus
  164. ; +---------------------+ locals for each
  165. ; | | Track diskette drive
  166. ; | driveX | |
  167. ; | | DriveMisc |
  168. ; +---------------------+ |
  169. ; | | FloppyLclEnd |
  170. ; | "more driver vars" | |
  171. ; | | SonyVarEnd <-----+
  172. ; +---------------------+ <-----+
  173. ; | | Track |
  174. ; | driveN | |
  175. ; | | DriveMisc |
  176. ; +---------------------+
  177. ; | | DCD driver vars
  178. ; | driveN | plus locals for
  179. ; | | each DCD drive
  180. ; +---------------------+ |
  181. ; | | DCDCmd |
  182. ; | DCD driver locals | |
  183. ; | | DiskVarLth <-----+
  184. ; +---------------------+
  185. ;
  186. ;_______________________________________________________________________
  187. ;
  188.  
  189.  
  190.                   IF          supportsMFM THEN
  191. ;_______________________________________;
  192. ;
  193. ;  SWIM MFM register offsets from base
  194. ;_______________________________________;
  195.  
  196.  
  197.  
  198. wData             EQU         $0000                     ;Write a data byte
  199. wMark             EQU         $0200                     ;Write a mark byte
  200. wCRC              EQU         $0400                     ;Write a 2-byte CRC (1 access does both)
  201. wIWMConfig        EQU         wCRC                      ;Set IWM configuration
  202. wParams           EQU         $0600                     ;Set the 16 parameter registers
  203. wPhase            EQU         $0800                     ;Set phase lines states and directions
  204. wSetup            EQU         $0A00                     ;Set the current configuration
  205. wZeroes           EQU         $0C00                     ; Mode reg: 1's clr bits, 0's=don't care
  206. wOnes             EQU         $0E00                     ;Mode reg: 1's set bits, 0's=don't care
  207. rData             EQU         $1000                     ;Read a data byte
  208. rCorrection       EQU         rData                     ;Read the correction factor
  209. rMark             EQU         $1200                     ;Read a mark byte
  210. rError            EQU         $1400                     ;Error register
  211. rParams           EQU         $1600                     ;Parameters (16 bytes deep at this addr)
  212. rPhase            EQU         $1800                     ;Phase lines states and directions
  213. rSetup            EQU         $1A00                     ;Read the current configuration
  214. rStatus           EQU         $1C00                     ;Status (returns current mode reg value)
  215. rHandshake        EQU         $1E00                     ;Handshake register
  216. mfmSectTime       EQU         75                        ;7.5msec sector time
  217. maxMFMSectors     EQU         18                        ;18 MFM sectors/track side (@1440K)
  218.                   ENDIF
  219.  
  220. maxGCRSectors     EQU         12                        ;12 GCR sectors/track side (max)
  221. diskUnitPtr       EQU         0                         ; pointer to device control entry
  222. diskQVE           EQU         diskUnitPtr+4             ; disk VBL task control block
  223. drive             EQU         diskQVE+14                ; * 0001 = int drive, 0002 = ext drive
  224. wait              EQU         drive+2                   ; extra wait time for speed changes
  225. sideTrack         EQU         wait+2                    ; destination side/track
  226. oneToOne          EQU         sideTrack+2               ; open up rupts flg (no longer used)
  227. active            EQU         oneToOne+1                ; * non-zero when driver is active
  228. timeOut           EQU         active+1                  ; * power time out
  229. diskBuffer        EQU         timeOut+2                 ; pointer to track data buffer
  230. firstSect         EQU         diskBuffer+4              ; low sector number needed on a track
  231. sectMap           EQU         firstSect+2               ; bit map of sectors needed on a track
  232. firstFSeq         EQU         sectMap+4                 ; first file seq # for current r/w request
  233. fBlksDone         EQU         firstFSeq+2               ; file blocks done previous to this track
  234. readErrInit       EQU         fBlksDone+2               ; init value, read error countdown cntr
  235. readErrCnt        EQU         readErrInit+1             ; read error countdown cntr
  236. recalInit         EQU         readErrCnt+1              ; init value, recal count
  237. recalCnt          EQU         recalInit+1               ; recal count
  238. wrgSectInit       EQU         recalCnt+1                ; init value, wrong sector countdown cnt
  239. wrgSectCnt        EQU         wrgSectInit+1             ; wrong sector countdown cnt
  240. badSpdInit        EQU         wrgSectCnt+1              ; init value, bad speed
  241. badSpdCnt         EQU         badSpdInit+1              ; bad speed countdown value
  242. command           EQU         badSpdCnt+1               ; I/O command
  243. headSettle        EQU         command+2                 ; disk head settle time (@100usec)
  244. spdChgTime        EQU         headSettle+2              ; motor speed change time (@100usec)
  245. pwrOnTime         EQU         spdChgTime+2              ; * power-on wait time (@100usec)
  246. pwrOffTime        EQU         pwrOnTime+2               ; * power down time (@1/2sec)
  247. seekTime          EQU         pwrOffTime+2              ; seek wait time (@100usec)
  248. sectTime          EQU         seekTime+2                ; * sector time (@100usec)
  249. dskVBLTime        EQU         sectTime+2                ; VBL task time (@16ms)
  250. ejectTime         EQU         dskVBLTime+2              ; Eject time (@100usec)
  251. ckDelta           EQU         ejectTime+2               ; delta time before speed recheck
  252. ejectWait         EQU         ckDelta+4                 ; VBL times after eject to ignore DIP
  253.  
  254. ; Format/Verify code reuses some of these fields as follows:
  255.  
  256. gapSync           EQU         sectMap                   ; (2) start with 7 groups of intersector sync
  257. twoSided          EQU         command                   ; (1) set non-zero for 2-sided format
  258. sectSave          EQU         firstSect                 ; (2) SectMpSave must follow
  259. sectMapSave       EQU         sectMap                   ; (8) uses SectMap, FirstFSeq, FBlksDone
  260. sectCnt           EQU         firstSect                 ; (2) loop counter . . .
  261.  
  262. ;_______________________________________;
  263. ;
  264. ; (2) Drive-specific vars.
  265.  
  266. drvLclLth         EQU         66
  267. drive1            EQU         ejectWait+2               ; * internal drive variables
  268. drive2            EQU         drive1+drvLclLth          ; * external drive variables
  269.  
  270.                   IF          onMac|onNuMac|onMvMac THEN
  271. floppyLclEnd      EQU         drive2+drvLclLth
  272.                   ENDIF
  273.  
  274.                   IF          onMacPP | onHcMac THEN
  275. drive3            EQU         drive2+drvLclLth          ; * real external for MacPP
  276. floppyLclEnd      EQU         drive3+drvLclLth
  277.                   ENDIF
  278.  
  279. track             EQU         0                         ; current track location (used for spd)
  280. writeProt         EQU         2                         ; * bit7=1=write-protected
  281. diskInPlace       EQU         3                         ; * $FC-$FF= just ejected,
  282. ; 0=no disk in place,1=DIP,2=clamped
  283. installed         EQU         4                         ; * 0=don't know, 1=inst., $FF=not inst.
  284. sides             EQU         5                         ; * bit7=0=1 sided
  285. dqel              EQU         6                         ; drive queue element for this drive
  286. driveQLink        EQU         6
  287. driveQVers        EQU         10
  288. driveSize         EQU         18                        ; drive block size (DCD only!)
  289. twoSideFmt        EQU         18                        ; * non-zero if 2-sided format
  290. newIntf           EQU         19                        ; $FF if new interface, $00 for old 
  291. driveErrs         EQU         20                        ; drive soft errs
  292. driveS1           EQU         20                        ; drive block size (high word)
  293. driveType         EQU         22                        ; old OffSpeed (no longer supported)
  294. driveManf         EQU         24
  295. driveChar         EQU         26
  296.  
  297.                   IF          supportsMFM THEN
  298. mfmDrive          EQU         22                        ;$FF=SuperDrive, $00=400K or 800K GCR
  299. mfmDisk           EQU         23                        ;$FF=MFM, $00=GCR or unformatted
  300. twoMegFmt         EQU         24                        ;$FF=2 meg MFM (1440K), $00=1 meg (720K)
  301.                   ENDIF
  302.  
  303. driveMisc         EQU         27
  304. spdAdjCnt         EQU         24                        ; speed adjust count this drive
  305. trkSpeedTbl       EQU         26                        ; 5-entry track speed table
  306. tSTblCode         EQU         0                         ; first is speed code
  307. tSTblDelta        EQU         2                         ; 2% speed code delta
  308. tSTblTicks        EQU         4                         ; longword last time checked tick cnt
  309. trkSTEnd          EQU         66                        ; end of drive vars
  310.  
  311. ;_______________________________________;
  312. ;
  313. ; (3) More driver local vars.
  314.  
  315. wakeTimeCnt       EQU         floppyLclEnd              ; WakeUp remainder count
  316. saveRegs          EQU         wakeTimeCnt+2             ; * wakeup routine saves D3-D7,A3-A6 here
  317. tagBufPtr         EQU         saveRegs+36               ; if non-zero, pointer to separate
  318.                                                         ; buffer for file tags . . .
  319. tagBufOS          EQU         tagBufPtr+4               ; temp offset into buffer
  320. diskErrs          EQU         tagBufOS+2                ; global soft errors
  321. passThru          EQU         diskErrs+2                ; 0 if pass thru on external port
  322.                   IF          supportsMFM THEN
  323. hasSuperDrives    EQU         passThru+1                ; $FF if at least 1 SuperDrive connected
  324. curSector         EQU         hasSuperDrives+1          ; current sector being read/written 
  325.                   ELSE
  326. sonyExtra         EQU         passThru+1                ; extra byte
  327. curSector         EQU         sonyExtra+1               ; current sector being read/written 
  328.                   ENDIF
  329.  
  330. tcRdEnable        EQU         curSector+2               ; (byte) set non-zero to activate reads into cache
  331. tcInstalled       EQU         tcRdEnable+1              ; (byte) non-zero when caching is installed and on
  332. tcDrive           EQU         tcInstalled+1             ; (word) drive number of cache blks (zero to inval)
  333. tcSideTrack       EQU         tcDrive+2                 ; (word) side/track of cache blocks 
  334. tcSectMap         EQU         tcSideTrack+2             ; (long) bitmap of sectors currently cached 
  335. tcBuffer          EQU         tcSectMap+4               ; (long) pointer to track cache buffer (512+12)*12
  336. tcNumCached       EQU         tcBuffer+4                ; (word) number read into cache 
  337. tcNumUsed         EQU         tcNumCached+2             ; (word actual number used
  338. lastDrive         EQU         tcNumUsed+2               ; (word) set at CkDrvNum to previous value of Drive
  339. timeOutDrive      EQU         lastDrive+4               ; (word) set at PowerDown to value of Drive 
  340. ; Above value should have been +2 since lastDrive is a word.
  341. timeQEl           EQU         timeOutDrive+2            ; a time queue element
  342.  
  343.                   IF          onMac THEN
  344. nextGZProc        EQU         timeQEl+tmQSize-2         ; (long) saved old GZ proc
  345. ; Above had been +tmQSize, but that changed from $C to $E.
  346. sonyVarEnd        SET         nextGZProc+4              ; end of sony vars excluding DCD
  347.                   ELSE
  348. nextGZProc        EQU         timeQEl+tmQSize           ; (long) saved old GZ proc
  349. driveXlat         EQU         nextGZProc + 4            ; drive translate table (GetDrive,DiskOpen)
  350. drvTblPtr         EQU         driveXlat+((maxDrvNum+1)*2) 
  351.                                                         ; (long) pointer to DrvTbl to use
  352. sonyVarEnd        SET         drvTblPtr+4
  353.                   ENDIF
  354.  
  355.                   IF          supportsMFM THEN
  356. isSWIM            EQU         sonyVarEnd                ;FDC type: $FF=SWIM, $00=IWM
  357. mfmMode           EQU         isSWIM+1                  ;Current register set selected: $FF=SWIM, $00=IWM
  358. sonyVarEnd        SET         mfmMode+1                 ; end of sony vars excluding DCD
  359.                   ENDIF
  360.  
  361.                   IF          onHcMac THEN
  362. chipState         EQU         sonyVarEnd                ; Byte holds flag to indicate IWM on or off
  363. sonyVarEnd        SET         chipState+2               ; end of sony vars excluding DCD
  364.                   ENDIF
  365.  
  366.  
  367.                   IF          onMac|onNuMacDCD THEN
  368. ;_______________________________________;
  369. ;
  370. ; (4) Direct-connect driver locals.
  371.  
  372. tagSize           EQU         20                        ; 20 bytes tags/block
  373. dcdLclLth         EQU         28                        ; (use fields through DriveMisc)
  374. drive3            EQU         sonyVarEnd                ; first DCD 
  375. drive4            EQU         drive3+dcdLclLth          ; second DCD
  376. drive5            EQU         drive4+dcdLclLth          ; third DCD
  377. drive6            EQU         drive5+dcdLclLth          ; fourth DCD
  378.  
  379.                   ENDIF
  380.  
  381.                   IF          onMacPP|onHcMac THEN
  382. ;_______________________________________;
  383. ;
  384. ; (4) Direct-connect driver locals.
  385.  
  386. tagSize           EQU         20                        ; 20 bytes tags/block
  387. dcdLclLth         EQU         28                        ; (use fields through DriveMisc)
  388. drive4            EQU         sonyVarEnd                ; first DCD
  389. drive5            EQU         drive4+dcdLclLth          ; second DCD
  390. drive6            EQU         drive5+dcdLclLth          ; third DCD
  391.                   ENDIF
  392.  
  393.                   IF          onMac|onMacPP|onHcMac|onNuMacDCD THEN
  394.  
  395.  
  396. stsRtnAddr        EQU         drive6+dcdLclLth          ; DCD status call return address
  397. dcdCmd            EQU         stsRtnAddr+4              ; command byte to DCD
  398. response          EQU         dcdCmd                    ; response byte (command+$80)
  399. seqNum            EQU         response+1                ; mb sequence number (sys commands only)
  400. status            EQU         seqNum+1                  ; returned status bytes
  401. startBlock        EQU         status                    ; starting block # (in commands)
  402. driveOut          EQU         startBlock+3              ; we send drive number in this field
  403. driveIn           EQU         status+2                  ; low 6 bits
  404. tagBytes          EQU         status+4                  ; tag bytes get stuffed here temporarily
  405. devType           EQU         tagBytes                  ; first 20 bytes of status are written
  406. devManufctr       EQU         devType+2                 ; in the 20-byte tag buffer
  407. devChar           EQU         devManufctr+2
  408. devBlks           EQU         devChar                   ; low 3 bytes of this longword
  409. devSpares         EQU         devChar+4
  410. devBadBlks        EQU         devSpares+2
  411. devMisc           EQU         devBadBlks+2              ; 8 bytes misc
  412. bufSize           EQU         tagBytes+tagSize          ; number of bytes/block
  413. lastStatus        EQU         bufSize+4                 ; last status returned
  414. lastResult        EQU         lastStatus+4              ; error type
  415. dcdFlags          EQU         lastResult+1              ; flag of whether we've done a reset
  416. chkTime           EQU         dcdFlags+1                ; 100usec check ready count
  417. maxTime           EQU         chkTime+2                 ; maximum number of checks
  418. stsBuffer         EQU         maxTime+2                 ; 512 bytes of status
  419. devReserve        EQU         stsBuffer
  420. devIcon           EQU         devReserve+44
  421. devFiller         EQU         devIcon+256               ; 32 bytes for optional name
  422. diskVarLth        EQU         devFiller+32
  423. stsBufSize        EQU         diskVarLth-stsBuffer
  424.  
  425.                   ELSE                                  ;
  426. diskVarLth        EQU         sonyVarEnd                ;
  427.                   ENDIF                                 ;
  428.  
  429. ; device characteristics byte:
  430.  
  431. devChEject        EQU         4                         ; ejectable if 1
  432. devChWP           EQU         3                         ; write protected if 1
  433. devChIcon         EQU         2                         ; icon available if 1
  434.  
  435.  
  436. ;_______________________________________;
  437. ; ;
  438. ; Drive Constants: ;
  439. ;_______________________________________;
  440.  
  441.  
  442. dqSides           EQU         -1                        ; Bit 7 of this byte: 0=single-sided Sony, 1=double sided
  443. dqInstall         EQU         -2                        ; 0=unknown, 1=installed, FF=no disk
  444. dqDIP             EQU         -3                        ; $FC-$FF = disk just ejected,
  445. ; 0 = no disk in place
  446. ; 1 = disk in place
  447. ; 2 = disk has been read
  448. ; >8 = non-ejectable disk
  449. dqWrPrt           EQU         -4                        ; Bit 7 of this byte: 1=disk is write protected.
  450.  
  451. ;_______________________________________;
  452. ;
  453. ; (1) Floppy drive constants (tuneable).
  454.  
  455. kSeekTime         EQU         120                       ; 12 ms trk-to-trk
  456. kHdSetTime        EQU         300                       ; 30 ms head settle time
  457. kEjectTime        EQU         7500                      ; .75 seconds eject time
  458. kEjectWait        EQU         -4                        ; - number of VBL calls after eject before dip check
  459. kSectTime         EQU         100                       ; minimum sector time in 100 us increments (10 ms)
  460. kPowerOn          EQU         4000                      ; read/write powerup time in 100 us increments
  461. kRWPOff           EQU         5                         ; read/write power off time (in 1/2 seconds)
  462. kDskVBLTime       EQU         30                        ; happens every 1/2 second
  463. kSpdChgTime       EQU         1500                      ; speed change wait time = 150ms
  464. kCkDelta          EQU         14400                     ; speed check delta time (in 1/60 sec) (4 min)
  465.  
  466. ;_______________________________________;
  467. ;
  468. ; (2) Floppy drive sense/control constants.
  469. ; (ca1-ca0-sel-ca2).
  470.  
  471. dirLAdr           EQU         0                         ; dirtn low
  472. dirHAdr           EQU         1
  473. rdDtaAdr          EQU         1                         ; side 0 read data
  474. rdDta1Adr         EQU         3                         ; side 1 read data
  475. stepLAdr          EQU         4                         ; step low and step sense address
  476. stepHAdr          EQU         5
  477.                   IF          supportsMFM THEN
  478. mfmModeAdr        EQU         6                         ;Switch drive into MFM (constant) mode
  479. gcrModeAdr        EQU         7                         ;Switch drive into GCR (variable) mode
  480.                   ENDIF
  481. mtrOnAdr          EQU         8
  482. mtrOffAdr         EQU         9
  483. ejectLAdr         EQU         12
  484. ejectHAdr         EQU         13
  485. dipAdr            EQU         2                         ; disk in place sense address
  486. mfmDrvAdr         EQU         5                         ;1=SuperDrive, 0=400K or 800K GCR
  487. wrProtAdr         EQU         6                         ; write protect sense address
  488. sidesAdr          EQU         9                         ; sense for number of sides
  489. tk0Adr            EQU         10                        ; track 0 sense address
  490. readyAdr          EQU         11                        ; /Ready sense address
  491. drvExstAdr        EQU         13                        ; sense=0 when a drive is connected
  492. tachAdr           EQU         14                        ; tach feedback sense address
  493. newIntfAdr        EQU         15                        ; implements ready handshake if 1
  494.                   IF          supportsMFM THEN
  495. twoMegAdr         EQU         15                        ;0=1 meg disk, 1=2 meg disk
  496.                   ENDIF
  497.  
  498. ;_______________________________________;
  499. ;
  500. ; (3) Floppy drive formatting constants.
  501.  
  502. fmtByte           EQU         $02                       ; 2-1 interleave, single-sided
  503. fmt2Byte          EQU         $22                       ; 2-1 interleave, double-sided
  504. mustFindCt        EQU         1500
  505. minSync           EQU         4                         ; min number of inter-sector sync groups
  506.                   IF          supportsMFM THEN
  507.  
  508. numSDFmts         EQU         3                         ; 2 GCR + 1 MFM single-density
  509. numDDFmts         EQU         1                         ; 1 MFM double-density format
  510.                   ELSE
  511. numSDFmts         EQU         2                         ; 2 GCR single density formats
  512.                   ENDIF
  513.  
  514.                   IF          onMac|onMacPP|onHcMac|onNuMacDCD THEN
  515. ;_______________________________________;
  516. ;
  517. ; (4) Direct-connect drive constants.
  518.  
  519. blkSize           EQU         512                       ; 512 bytes data/block
  520. syncByte          EQU         $AA                       ; Sync byte for start of transmission
  521. nonZerStat        EQU         1
  522. comErr            EQU         2
  523.  
  524. ; New HD20 error codes
  525.  
  526. wrtHsLw           EQU         $10                       ; HSHK low before starting
  527. wrtHSLwTO         EQU         $11                       ; Time out waiting for HSHK to go low
  528. wrtHSHighTO       EQU         $13                       ; Time out waiting for HSHK to go high
  529. rdHsHi            EQU         $20                       ; HSHK high before starting
  530. rdSyncTO          EQU         $21                       ; Time out waiting for sync ($AA) bye
  531. rdGroupTO         EQU         $22                       ; Time out waiting for group
  532. rdHoffSyncTO      EQU         $24                       ; Time out waiting for sync after holdoff
  533. rdHsHiTO          EQU         $25                       ; Time out waiting for HSHK high
  534. rdChksumErr       EQU         $26                       ; Checksum error on response packet
  535. invalidResp       EQU         $30                       ; First byte in response packet was wrong
  536. sqncNumErr        EQU         $31                       ; Sequence number in response packet was wrong
  537. dNumberErr        EQU         $32                       ; Drive number in response packet was wrong
  538. noResp            EQU         $40                       ; No response packet ever received
  539.  
  540. ; LastStatus
  541.  
  542. opFailed          EQU         24                        ; bit to test for operation failed
  543. bChksum           EQU         30                        ; bit number for checksum error
  544.  
  545. ; DCDFlags
  546.  
  547. resetonce         EQU         0
  548. retryonce         EQU         1
  549. maxTries          EQU         4                         ; max # times to try command
  550. tSeekChk          EQU         10                        ; check during a seek every 1 ms
  551. tSeekMax          EQU         10000                     ; max time for seek = 10 secs
  552. tStsChk           EQU         10                        ; check during a status every 1 ms
  553. tStsMax           EQU         10000                     ; max time for status = 10 secs
  554. tQuickTime        EQU         100
  555. tNextChk          EQU         7                         ; check for next block after 700 µsec
  556. tNextMax          EQU         10000                     ; max time for next block = 7 secs
  557. tFVChk            EQU         100                       ; check during fmt/vfy every 10 ms
  558. tFVMax            EQU         18000                     ; max time for fmt/vfy = 3 minutes
  559. tRstAssert        EQU         1000                      ; assert reset for 100 msec
  560. tRstSettle        EQU         20000                     ; 2 sec wait for busy to settle
  561. tRstChk           EQU         100                       ; check during reset every 10 ms
  562. tRstMax           EQU         1600                      ; max time for reset = 16 seconds
  563.  
  564. ; DCD sense/cntl addr (ca1-ca0-sel-ca2)
  565.  
  566. dcdExist          EQU         5                         ; /Exist (/Sides=/DrvIn=1 also)
  567. dcdReset          EQU         1                         ; for 1ms resets DCD controller
  568.                   ENDIF                                 ;
  569.  
  570. ;_______________________________________;
  571. ; ;
  572. ; Driver Constants: ;
  573. ;_______________________________________;
  574.  
  575. ;_______________________________________;
  576. ;
  577. ; (1) Driver Control codes.
  578.  
  579. verifyCC          EQU         5                         ; 'verify' control code
  580. formatCC          EQU         6                         ; 'format' control code
  581. tagBufCC          EQU         8                         ; 'set tag buffer' control code
  582. tCacheCC          EQU         9                         ; 'track cache' control 
  583. iconIDCC          EQU         20                        ; 'get icon id' control code
  584. iconCC            EQU         21                        ; 'get icon' control code
  585. iconLogCC         EQU         22                        ; 'get logical icon' code
  586. infoCC            EQU         23                        ; 'get drive info' code
  587.                   IF          forDiskDup THEN
  588. FmtCopyCC         EQU         $5343                     ;one-pass format/copy/verify for disk duplicator
  589.                   ENDIF
  590.  
  591. ; (2) Driver Status codes.
  592.  
  593. fmtLstCode        EQU         6                         ;Returns a list of disk formats
  594.                   IF          supportsMFM THEN
  595. mfmStsCode        EQU         10                        ;'Get MFM status' status code
  596.                   ENDIF
  597.                   IF          forDiskDup THEN
  598. DupVerSts         EQU         $4456                     ;disk duplicator version supported (to match features)
  599. FmtByteSts        EQU         $5343                     ;return address header format byte
  600.                   ENDIF                                 ; for disk duplicator
  601.  
  602.  
  603. ;_______________________________________;
  604. ;
  605. ; Driver Vectors: ;
  606. ;_______________________________________;
  607.  
  608. ;_______________________________________;
  609. ;
  610. ; (1) Location of disk routine vectors.
  611.  
  612. jFigTrkSpd        EQU         DiskVars
  613. jDiskPrime        EQU         jFigTrkSpd+4
  614. jRdAddr           EQU         jDiskPrime+4
  615. jRdData           EQU         jRdAddr+4
  616. jWrData           EQU         jRdData+4
  617. jSeek             EQU         jWrData+4
  618. jSetUpPoll        EQU         jSeek+4
  619. jRecal            EQU         jSetUpPoll+4
  620. jControl          EQU         jRecal+4
  621. jWakeUp           EQU         jControl+4
  622. jReSeek           EQU         jWakeUp+4
  623. jMakeSpdTbl       EQU         jReSeek+4
  624. jAdrDisk          EQU         jMakeSpdTbl+4
  625. jSetSpeed         EQU         jAdrDisk+4
  626. niblTbl           EQU         jSetSpeed+4
  627. jDiskSel          EQU         $B40                      ; (long) vector to .Sony DiskSelect routine 
  628. jSendCmd          EQU         $B44                      ; (long) vector to .Sony DCD SendCmd routine
  629. jDCDReset         EQU         $B48                      ; (long) vector to .Sony DCD DCDReset routine
  630.  
  631.                   IF          supportsMFM THEN
  632. jMRdAddr          EQU         $680                      ; (long) vector to MFM MRdAddr
  633. jMRdData          EQU         jMRdAddr+4                ; (long) vector to MFM MRdData
  634. jMWrData          EQU         jMRdData+4                ; (long) vector to MFM MWrData
  635.                   ENDIF
  636.  
  637.                   ENDIF                                 ;end exclusion of private information
  638.  
  639.     ENDIF    ; ...already included